package com.zhanshen.service.impl;

import com.zhanshen.dao.PersonalDao;
import com.zhanshen.pojo.Personal;
import com.zhanshen.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonalServiceImpl implements PersonalService {

    @Autowired
    private PersonalDao personalDao;

    @Override
    public Personal addUser(Personal personal) {
        Personal select = personalDao.select(personal);

        //  查看数据库是否有手机号
        if (select==null) {
            personalDao.addUser(personal);
        }else {
        }
        return personalDao.login(personal);
    }

    @Override
    public int updateUser(Personal personal) {

        return personalDao.updateUser(personal);
    }

    @Override
    public int updatePaw(Personal personal) {

        return personalDao.updatePaw(personal);
    }


}
